package com.cyl.wms.controller;

import com.cyl.wms.domain.Address;
import com.cyl.wms.domain.Area;
import com.cyl.wms.domain.Platform;
import com.cyl.wms.pojo.query.AddrQuery;
import com.cyl.wms.pojo.query.AreaQuery;
import com.cyl.wms.pojo.query.PlatformQuery;
import com.cyl.wms.service.AddrService;
import com.cyl.wms.service.PlatformService;
import com.ruoyi.common.core.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 地址码Controller
 * 
 * @author csslisi
 * @date 2022-08-05
 */
@Api("月台接口列表")
@RestController
@RequestMapping("/wms/platform")
public class PlatformController extends BaseController {
    @Autowired
    private PlatformService service;

    @ApiOperation("查询地址列表")
    @PreAuthorize("@ss.hasPermi('wms:platform:list')")
    @PostMapping("/list")
    public ResponseEntity<Page<Platform>> list(@RequestBody PlatformQuery query, Pageable page) {
        List<Platform> list = service.selectList(query, page);
        return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
    }

}
